<%@page isELIgnored="false" import="java.net.*" %>
<%@taglib prefix="tiles" uri="struts-tiles" %>
<%@taglib prefix="html" uri="struts-html" %>
<%@taglib prefix="bean" uri="struts-bean" %>
<%@taglib prefix="c" uri="jstl" %>
<%@taglib prefix="mcfn" uri="mcfn" %>
<%@taglib prefix="fn" uri="jstl-fn" %>

<%@page import="com.mastercard.assets.web.util.to.UserLogin"%><c:set var="Alertas" value="${Tarea.tblFormaAlertas}" />
<c:set var="AlertasLength" value="${fn:length(Alertas)}" />
				<div id="bodyContent">
						<html:form action="/TareasOperation" method="post" styleId="TareasForm">
						<h1><bean:message key="com.mastercard.assets.web.modules.tareas.index.labels.Alertas"/></h1>
						<div onclick="location.href='${URLBase}Flujos.do';" style="display: inline; color: blue; font-size: 12px;" onmouseover="this.style.textDecoration='underline';this.style.cursor='pointer';" onmouseout="this.style.textDecoration='none';this.style.cursor='default';" >Flujos</div><div style="display: inline; color: black; font-size: 12px;" > > </div>
						<div onclick="document.getElementById('operation').value=17;document.getElementById( 'TareasForm' ).submit( );" style="display: inline; color: blue; font-size: 12px;" onmouseover="this.style.textDecoration='underline';this.style.cursor='pointer';" onmouseout="this.style.textDecoration='none';this.style.cursor='default';" >Tareas del Flujo (${Tarea.tblFlujo.nombre})</div><div style="display: inline; color: black; font-size: 12px;" > > </div>
						<div onclick="document.getElementById('operation').value=4;document.getElementById('TareasForm').submit( );" style="display: inline; color: blue; font-size: 12px;" onmouseover="this.style.textDecoration='underline';this.style.cursor='pointer';" onmouseout="this.style.textDecoration='none';this.style.cursor='default';" >Editar Salidas de la Tarea (${Tarea.nombre})</div><div style="display: inline; color: black; font-size: 12px;" > > </div>
						<div style="display: inline; color: black; font-size: 12px;"  >Alertas de la Salida (${Salida.nombre}) de la Tarea (${Tarea.nombre})</div>
						<br/>
						<br/>
						<div style="width: 100%; text-align: right;"><html:image src="images/btnRegresar.gif" style="display: inline;" onclick="document.getElementById('operation').value=4;document.getElementById('TareasForm').submit( );" /></div>
						<br/>
						<html:hidden property="cveFlujo" styleId="cveFlujo" value="${TareasOperationForm.cveFlujo}"  />
						<html:hidden property="cveTarea" styleId="cveTarea"  />
						<html:hidden property="cveAlerta" styleId="cveAlerta"  />
						<html:hidden property="cveFormaAlerta" styleId="cveFormaAlerta"  />
						<html:hidden property="cveSalida" styleId="cveSalida" value="${TareasOperationForm.cveSalida}"  />
						<html:hidden property="operation" styleId="operation" />
						<html:hidden property="page" value="1" />
						</html:form>
						Flujo: ${Tarea.tblFlujo.nombre}
						<br/>
						Tarea: ${Tarea.nombre}
						<br/>
						Salida: ${Salida.nombre}
						<br/>
						<table style="border: 0px solid red ; width: 100%;" border="0" >
							<tr>
								<td colspan="3" align="right">
									<html:image src="images/btnAdd.gif" onclick="document.getElementById('operation').value=6;document.getElementById('TareasForm').submit( );" />
								</td>
							</tr>
						</table>
						<table class="tabDatos">
<c:choose>
<c:when test="${AlertasLength gt 0}">
							<thead>
								<tr>
									<th width="18%"><bean:message key="com.mastercard.assets.web.modules.tareas.add.alertas.labels.head.Alerta"/></th>
									<th width="18%"><bean:message key="com.mastercard.assets.web.modules.tareas.add.alertas.labels.head.Rol"/></th>
									<th width="18%"><bean:message key="com.mastercard.assets.web.modules.tareas.add.alertas.labels.head.Nivel"/></th>
									<th width="18%"><bean:message key="com.mastercard.assets.web.modules.tareas.add.alertas.labels.head.Tipo"/></th>
									<th width="18%"><bean:message key="com.mastercard.assets.web.modules.tareas.add.alertas.labels.head.Correo"/></th>
									<th width="10%">&nbsp;</th>
								</tr>
							</thead>
<c:forEach items="${Alertas}" var="alerta" varStatus="alertaStatus">
<c:if test="${alerta.status eq 1 and alerta.tblFormaSalida.cveSalida eq Salida.cveSalida}">
							<tr>
								<td>${mcfn:getShortString(alerta.tblAlerta.nombre,20)}</td>
								<td>${mcfn:getShortString(alerta.tblRole.nombre,20)}</td>
								<td><c:if test="${alerta.tblNivel.nombre eq ''}">Todos los niveles</c:if><c:if test="${alerta.tblNivel.nombre ne ''}">${mcfn:getShortString(alerta.tblNivel.nombre,20)}</c:if></td>
								<td><c:choose><c:when test="${alerta.tipo eq 1}">Correo</c:when><c:when test="${alerta.tipo eq 2}">Pantalla</c:when><c:when test="${alerta.tipo eq 3}">Ambos</c:when><c:otherwise>Desconocida</c:otherwise></c:choose></td>
								<td>${mcfn:getShortString(alerta.email,24)}</td>
								<td>
									<html:image src="images/btnEliminar.gif" onclick="document.getElementById('operation').value=7;document.getElementById('cveFormaAlerta').value=${alerta.cveFormaAlerta};document.getElementById('TareasForm').submit( );" />
									 &nbsp; 
									<html:image style="display:inline;" src="images/btnEdit.gif" onclick="document.getElementById('operation').value=8;document.getElementById('cveFormaAlerta').value=${alerta.cveFormaAlerta};document.getElementById('TareasForm').submit( );" />
								</td>
							</tr>
</c:if>
</c:forEach>
</c:when>
<c:otherwise>
							<tr>
								<td colspan="3">
									<bean:message key="com.mastercard.assets.web.modules.tareas.add.alertas.messages.NoAlertasExist" arg0="${Salida.nombre}" arg1="${Tarea.nombre}" arg2="${Tarea.tblFlujo.nombre}" />
								</td>
							</tr>
</c:otherwise>
</c:choose>
						</table>
						



					</div>
					<div id="footContent"></div>
<%
UserLogin user = ( UserLogin ) session.getAttribute( "UserLogin" ) ;
user.clearMessageError( ) ;
%>